﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AnesSystem.Models;
using AnesSystem.Services;
using MongoDB.Bson;
using AnesSystem.Controls;

using System.Collections;

using System.Collections.ObjectModel;

namespace AnesSystem.ViewModels
{
    public class ZhiKongXingXiViewModel : BaseViewModel<ZhiKongXingXiViewModel>
    {
        #region Variables

        Dictionary<string, List<ZhiKongXingXiModel>> _dic = new Dictionary<string, List<ZhiKongXingXiModel>>();

        List<ZhiKongXingXiModel> fenlei1List;
        List<ZhiKongXingXiModel> fenlei2List;
        List<ZhiKongXingXiModel> fenlei3List;
        List<ZhiKongXingXiModel> fenlei4List;
        List<ZhiKongXingXiModel> fenlei5List;
        List<ZhiKongXingXiModel> fenlei6List;
        List<ZhiKongXingXiModel> fenlei7List;
        List<ZhiKongXingXiModel> fenlei8List;
        List<List<ZhiKongXingXiModel>> _contentList;
        List<List<CustomCheckBoxCtrl>> _contentCtrlList;

        #endregion

        #region Constructor

        public ZhiKongXingXiViewModel()
        {
            _contentList = new List<List<ZhiKongXingXiModel>>();
            _contentCtrlList = new List<List<CustomCheckBoxCtrl>>();
            IntiteDisplay();
            IniteDic();
        }

        #endregion

        #region Properties

        public List<string> TitleList
        {
            get
            {
                return _dic.Keys.ToList();
            }
        }

        public List<List<ZhiKongXingXiModel>> ContentList
        {
            get
            {
                if (_contentList.Count == 0)
                {
                    foreach (var list in _dic.Values)
                    {
                        _contentList.Add(list);
                    }
                }
                return _contentList;
            }
        }

        public List<List<CustomCheckBoxCtrl>> ContentCtrlList
        {
            get
            {
                if (_contentList.Count == 0)
                {
                    foreach (var list in _dic.Values)
                    {
                        _contentList.Add(list);
                        List<CustomCheckBoxCtrl> ctrls = new List<CustomCheckBoxCtrl>();
                        foreach (var item in list)
                        {
                            CustomCheckBoxCtrl ctrl = new CustomCheckBoxCtrl();
                            ctrl.DisplayText = item.DisplayName;
                            ctrl.Height = 30;
                            ctrl.Width = 280;
                            ctrl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
                            ctrls.Add(ctrl);
                        }
                        _contentCtrlList.Add(ctrls);
                    }
                }
                return _contentCtrlList;
            }

            set
            {
                _contentCtrlList = value;
            }
        }

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        private void IniteDic()
        {
            _dic.Add("分类1", fenlei1List);
            _dic.Add("分类2", fenlei2List);
            _dic.Add("分类3", fenlei3List);
            _dic.Add("分类4", fenlei4List);
            _dic.Add("分类5", fenlei5List);
            _dic.Add("分类6", fenlei6List);
            _dic.Add("分类7", fenlei7List);
            _dic.Add("分类8", fenlei8List);

        }

        private void IntiteDisplay()
        {

            fenlei1List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("麻醉后手术取消", "麻醉后手术取消", "分类1"),
                new ZhiKongXingXiModel("Steward评分≥4", "Steward评分≥4", "分类1"),
                new ZhiKongXingXiModel("结束时使用催醒药物", "结束时使用催醒药物", "分类1"),


                };
            fenlei2List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("手术切口分类Ⅰ", "手术切口分类Ⅰ", "分类2"),
                  new ZhiKongXingXiModel("手术切口分类Ⅱ", "手术切口分类Ⅱ", "分类2"),
                new ZhiKongXingXiModel("手术切口分类Ⅲ", "手术切口分类Ⅲ", "分类2"),

                  new ZhiKongXingXiModel("手术切口分类Ⅳ", "手术切口分类Ⅳ", "分类2"),

                };
            fenlei3List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("心肺复苏", "心肺复苏", "分类3"),
                new ZhiKongXingXiModel("氧饱和度重度降低", "氧饱和度重度降低", "分类3"),
                 new ZhiKongXingXiModel("因误咽误吸引发呼吸道梗阻", "因误咽误吸引发呼吸道梗阻", "分类3"),
                  new ZhiKongXingXiModel("复苏成功", "复苏成功", "分类3"),
                   new ZhiKongXingXiModel("术中严重低血压", "术中严重低血压", "分类3"),
                    new ZhiKongXingXiModel("术中更换气管导管", "术中更换气管导管", "分类3"),
                     new ZhiKongXingXiModel("意外死亡", "意外死亡", "分类3"),
                      new ZhiKongXingXiModel("体外循环", "体外循环", "分类3"),
                       new ZhiKongXingXiModel("术中输血,输液反应", "术中输血,输液反应", "分类3"),
                };



            fenlei4List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("器官手术", "器官手术", "分类4"),
                new ZhiKongXingXiModel("浅层组织手术", "浅层组织手术", "分类4"),
                 new ZhiKongXingXiModel("深部组织手术", "深部组织手术", "分类4"),
                  new ZhiKongXingXiModel("腔隙内手术", "腔隙内手术", "分类4"),
                   new ZhiKongXingXiModel("一级手术","一级手术", "分类4"),
                    new ZhiKongXingXiModel("二级手术", "二级手术", "分类4"),
                    new ZhiKongXingXiModel("三级手术", "三级手术", "分类4"),
                    new ZhiKongXingXiModel("四级手术", "四级手术", "分类4"),
                    new ZhiKongXingXiModel("重大手术", "重大手术", "分类4"),

                };

            fenlei5List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("锁骨下深静脉穿刺", "锁骨下深静脉穿刺", "分类5"),
                new ZhiKongXingXiModel("中心静脉穿刺", "中心静脉穿刺", "分类5"),
                 new ZhiKongXingXiModel("足背动脉穿刺", "足背动脉穿刺", "分类5"),
                  new ZhiKongXingXiModel("中心V导管脱落", "中心V导管脱落", "分类5"),
                   new ZhiKongXingXiModel("锁骨上深静脉穿刺", "锁骨上深静脉穿刺", "分类5"),
                    new ZhiKongXingXiModel("桡动脉穿刺", "桡动脉穿刺", "分类5"),
                     new ZhiKongXingXiModel("动脉导管脱落", "动脉导管脱落", "分类5"),
                      new ZhiKongXingXiModel("颈内静脉穿刺", "颈内静脉穿刺", "分类5"),
                       new ZhiKongXingXiModel("股静脉穿刺", "股静脉穿刺", "分类5"),
                        new ZhiKongXingXiModel("多次穿刺", "多次穿刺", "分类5"),
                         new ZhiKongXingXiModel("穿刺点红肿流液", "穿刺点红肿流液", "分类5"),

                };

            fenlei6List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("非计划二次麻醉", "非计划二次麻醉", "分类6"),
                new ZhiKongXingXiModel("非计划二次手术", "非计划二次手术","分类6"),
                 new ZhiKongXingXiModel("多次插管", "多次插管","分类6"),
                  new ZhiKongXingXiModel("其他非预期相关事件", "其他非预期相关事件", "分类6"),
                   new ZhiKongXingXiModel("非计划改变麻醉方式", "非计划改变麻醉方式", "分类6"),
                    new ZhiKongXingXiModel("非计划二次气管插管", "非计划二次气管插管", "分类6"),
                     new ZhiKongXingXiModel("非计划转入ICU发生", "非计划转入ICU发生", "分类6"),
                      new ZhiKongXingXiModel("更改手术方式", "更改手术方式", "分类6"),

                };

            fenlei7List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("麻醉开始后24小时内心跳骤停", "麻醉开始后24小时内心跳骤停", "分类7"),
                new ZhiKongXingXiModel("PACU入室低体温发生", "PACU入室低体温发生", "分类7"),
                 new ZhiKongXingXiModel("PACU转出延迟(入PACU超过3小时)", "PACU转出延迟(入PACU超过3小时)", "分类7"),
                  new ZhiKongXingXiModel("麻醉开始后24小时内死亡", "麻醉开始后24小时内死亡", "分类7"),
                   new ZhiKongXingXiModel("麻醉期间严重过敏反应发生", "麻醉期间严重过敏反应发生", "分类7"),
                    new ZhiKongXingXiModel("中心静脉穿刺严重并发症发生", "中心静脉穿刺严重并发症发生", "分类7"),
                     new ZhiKongXingXiModel("椎管内麻醉后严重神经系统并发症发生", "椎管内麻醉后严重神经系统并发症发生","分类7"),

                };

            fenlei8List = new List<ZhiKongXingXiModel>() {
                new ZhiKongXingXiModel("恶心呕吐", "恶心呕吐", "分类8"),
                new ZhiKongXingXiModel("未预期意识障碍", "未预期意识障碍", "分类8"),
                new ZhiKongXingXiModel("麻醉手术后新发昏迷发生", "麻醉手术后新发昏迷发生", "分类8"),
                new ZhiKongXingXiModel("术后气管插管拔除", "术后气管插管拔除", "分类8"),
                new ZhiKongXingXiModel("麻醉后头疼", "麻醉后头疼", "分类8"),
                new ZhiKongXingXiModel("肢体活动障碍", "肢体活动障碍", "分类8"),
                new ZhiKongXingXiModel("全麻气管插管后声嘶发生", "全麻气管插管后声嘶发生", "分类8"),
                new ZhiKongXingXiModel("ASA-Ⅰ死亡", "ASA-Ⅰ死亡", "分类8"),
                new ZhiKongXingXiModel("ASA-Ⅲ死亡", "ASA-Ⅲ死亡", "分类8"),
                new ZhiKongXingXiModel("ASA-Ⅴ死亡", "ASA-Ⅴ死亡", "分类8"),
                 new ZhiKongXingXiModel("ASA-Ⅱ死亡", "ASA-Ⅱ死亡", "分类8"),
                  new ZhiKongXingXiModel("ASA-Ⅳ死亡", "ASA-Ⅳ死亡", "分类8"),


                };
        }

        #endregion

        #region Public/Protected Methods

        #endregion

        #region EventHandlers

        #endregion
    }
}

